package hy;

import hy.entity.A;
import hy.entity.B;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Test {
    public static void main(String[] args) {
        ApplicationContext a = new ClassPathXmlApplicationContext("u.xml");
//        System.out.println(a.getBean(A.class));
//        System.out.println(a.getBean("b2"));
        for (String name : a.getBeanDefinitionNames()) {
            System.out.println(name);
        }
        System.out.println(a.getBean("hello"));

    }

    public static void main1(String[] args) {
        ApplicationContext a = new ClassPathXmlApplicationContext("u.xml");
        System.out.println(a.getBean("c"));
    }
}
